<!--
 * @message: 头部注释
-->
<template>
  <Form
    :label-width="100"
    ref="formValidate"
    :rules="ruleValidate"
    :model="formValidate"
    label-position="left"
  >
    <FormItem label="版本号" prop="versionCode">
      <i-input
        type="text"
        v-model="formValidate.versionCode"
        placeholder="版本号"
      >
      </i-input>
    </FormItem>

    <FormItem label="更新内容" prop="updateIntro">
      <i-input
        type="textarea"
        v-model="formValidate.updateIntro"
        placeholder="更新内容"
      >
      </i-input>
    </FormItem>

    <FormItem label="客户端地址" prop="appPath">
      <i-input
        type="text"
        v-model="formValidate.appPath"
        placeholder="客户端地址"
      >
      </i-input>
    </FormItem>
    <FormItem label="二维码地址" prop="qrCode">
      <i-input
        type="text"
        v-model="formValidate.qrCode"
        placeholder="二维码地址"
      >
      </i-input>
    </FormItem>
    <!-- <FormItem label="强制更新" prop="isForcedUpdate">
      <Select v-model="formValidate.isForcedUpdate">
        <Option :value="0" key="0">否</Option>
        <Option :value="1" key="1">是</Option>
      </Select>
    </FormItem> -->
    <FormItem>
      <Button
        type="primary"
        @click="publicSubmit('formValidate')"
      >确定
      </Button>
      <Button @click="publicReset('formValidate')" style="margin-left: 8px">取消</Button>
    </FormItem>
  </Form>
</template>

<script>
import { updateMixin } from '../../../mixin'
import API_KEY from '../../../api'

export default {
  name: 'VersionUpdate',
  mixins: [updateMixin],
  data () {
    return {
      ruleValidate: {
        updateIntro: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        versionCode: [{ required: true, message: '当前项不能为空', trigger: 'blur' }]
      },
      // 请求地址
      action: {
        // 新增数据
        createData: API_KEY.version.curdVersion,
        // 更新数据
        updateData: API_KEY.version.curdVersion,
        readDataById: API_KEY.version.curdVersion
      },
      formValidate: {
        versionCode: '',
        updateIntro: '',
        appPath: '',
        isForcedUpdate: 1,
        qrCode: ''
      }
    }
  }
}
</script>

<style scoped>

</style>
